////////////////////////////hume to cp n luta dsa mai kaha dum tha////////////////////////
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define pob pop_back
#define lb lower_bound
#define ub upper_bound
#define sz(x) (int)(x).size()
#define len(x) (int)(x).length()
#define all(x) x.begin(), x.end()
#define maxe(x) max_element(x.begin(), x.end());
#define mine(x) min_element(x.begin(), x.end());
#define rev(x) reverse(all(x))
#define ndl cout << "\n";
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
#define Yes cout<<"Yes"<<endl;
#define No cout<<"No"<<endl;
#define minus cout<<"-1"<<endl;
#define jiro cout<<0<<endl;
#define vi vector<int>
#define vvi vector<vector<int>>
#define mii map<int,int>
#define pii pair<int, int>
#define vpi vector<pii>
#define umii unordered_map<int, int>
#define uset unordered_set
#define imin LLONG_MIN
#define imax LLONG_MAX
#define fi first
#define se second
#define set_bits __builtin_popcountll
#define setpr(i) cout << setprecision(i);
#define mems(t,x) memset(t , x , sizeof(t)) ;
#define print(x) cout<<x<<endl;
#define rep(i,k,n) for (int i = k; i < n; i++)
#define repb(i,n, k) for (int i = n; i >= k; i--)
// ll mod_add(ll a, ll b, ll m){a = a %m}
#ifndef ONLINE_JUDGE
#define dbg(x...) cerr << #x<<" " ; _print(x) ;cerr<< endl;
#else
#define dbg(x...);
#endif
//templates debugging
void _print(double a){cerr<<a<<endl;}
void _print(int a ){cerr<<a<<endl;}
void _print(char a){cerr<<a<<endl;}
// void _print(long long a ){cerr<<a<<endl;}
void _print(long double a ){cerr<<a<<endl;}
void _print(string a){cerr<<a<<endl;}
void _print(bool a){cerr<<a<<endl;}
// input template
template <class T> void input(vector<T> &v , int n){for(int i =0;i<n;i++){T x;cin>>x;v.pb(x);}}
template <class T> void input(vector<vector<T>> &v , int n , int m){for(int i =0;i<n;i++){vector<T> temp;for(int j =0;j<m;j++){T x;cin>>x;temp.pb(x);}v.pb(temp);}}
void init1(){
#ifndef ONLINE_JUDGE
freopen("inputf.in", "r", stdin);
freopen("outputf.in", "w", stdout);
#endif
}
void init2(){
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("degub.in", "w", stderr);
#endif
}
template <class T , class C > void _print(pair<T,C> p){cerr<<p.ft<<" "<<p.ss<<endl;}
template <class T> void _print(vector<T> a){cerr<<"[";for(auto &i:a){cerr<<i<<" ";}cerr<<"]";cerr<<endl;}
template <class T> void _print(set<T> a){cerr<<"[";for(auto &i:a){cerr<<i<<" ";}cerr<<"]";cerr<<endl;}
template <class T> void _print(unordered_set<T> a){cerr<<"[";for(auto &i:a){cerr<<i<<" ";}cerr<<"]";cerr<<endl;}
template <class T , class C> void _print(map<T,C> a){for(auto &i:a){cerr<<"["<<i.first<<"->"<<i.second<<"] ";}cerr<<endl;}
template <class T , class C> void _print(unordered_map<T,C> a){for(auto &i:a){cerr<<"["<<i.first<<"->"<<i.second<<"] ";}cerr<<endl;}
template <class T> void _print(vector<vector<T>> a){for(auto &i:a){cerr<<"[";for(auto &j:i){cerr<<j<<" ";}cerr<<"]";}}
template <class T > void _print(multiset<T> a){for(auto &i:a){cerr<<i<<" ";}cerr<<endl;}
///////////////////////////HUME TO CP Nai luta dsa mai kha dum tha/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void solve(){
int n;cin >> n;
int ttl =( n*(n-1)) / 2;
vi v;
input(v, ttl);
sort(all(v));
vi ans(n, imin);
int num = 0;
int i = 0;
while(num<n){
int j = i;
int ele= v[i];
int cnt = n - num - 1;
while(cnt--){
j++;
}
ans[num] = ele;
i = j;
num++;
}
ans[n-1] = 1e9;
rep(i, 0, n) cout<<ans[i]<<" ";
cout<<endl;
}
signed main()
{
init1();
init2();
int t ;cin >> t;
while(t--){
solve();
}
return 0;
}
349A - Cinema Line | 47A - Triangular numbers |
1516B - AGAGA XOOORRR | 1515A - Phoenix and Gold |
1515B - Phoenix and Puzzle | 155A - I_love_username |
49A - Sleuth | 1541A - Pretty Permutations |
1632C - Strange Test | 673A - Bear and Game |
276A - Lunch Rush | 1205A - Almost Equal |
1020B - Badge | 1353A - Most Unstable Array |
770A - New Password | 1646B - Quality vs Quantity |
80A - Panoramix's Prediction | 1354B - Ternary String |
122B - Lucky Substring | 266B - Queue at the School |
1490A - Dense Array | 1650B - DIV + MOD |
1549B - Gregor and the Pawn Game | 553A - Kyoya and Colored Balls |
1364A - XXXXX | 1499B - Binary Removals |
1569C - Jury Meeting | 108A - Palindromic Times |
46A - Ball Game | 114A - Cifera |